package com.moon.annotation;


import javax.annotation.Resource;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.moon.annotation.service.IBaseService;

@Service("Test")
public class Test {
	@Resource(name="baseService")
	private IBaseService baseService; 
	
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("config/spring/applicationContext.xml");
		Test test = (Test) ctx.getBean("Test");
		test.getBaseService().toDo();
		System.out.println("=======E N D=======");
	}

	public IBaseService getBaseService() {
		return baseService;
	}

	public void setBaseService(IBaseService baseService) {
		this.baseService = baseService;
	}
	
}
